package de.baumann.browser.views.dialog

import android.annotation.SuppressLint
import android.content.Context
import android.view.View
import de.baumann.browser.R
import kotlinx.android.synthetic.main.activity_my_card.*
import kotlinx.android.synthetic.main.dialog_buy_card.*

class BuyCardDialog(context: Context, var cardName: String, var cardPrice: String, var onClickListener: View.OnClickListener) : BaseDialog(context) {

    override fun laoutId(): Int {
        return R.layout.dialog_buy_card
    }


    override fun initView() {
        setCanceledOnTouchOutside(false)
        ivBuyCardClose.setOnClickListener {
            dismiss()
        }
        btnBuy.setOnClickListener {
            onClickListener.onClick(it)
        }
    }

    @SuppressLint("SetTextI18n")
    override fun show() {
        buyCardName.text = "确定购买$cardName"
        buyCardPrice.text = cardPrice+"ODIN"
        super.show()
    }

}